package com.zzl.bonds.ticket.constant.type;

import java.util.Arrays;
import java.util.List;

/**
 * 操作日志 操作类型枚举值
 *
 * @author : gull
 * @date : 2022/2/23 10:30
 */
public enum OperateLogTypeEnum {

    /**
     * 凭证开立
     */
    OPEN("1", "凭证开立"),
    REVIEW_PASS("2", "凭证复核"),
    APPROVE_PASS("3", "凭证审核"),
    SIGN("4", "凭证签收"),

    /**
     * 凭证转让
     */

    TRANSFER("5", "凭证转让"),
    WITHDRAW("11", "撤销"),
    TRANSFER_ROLLBACK("25", "拆分失败回滚"),
    REVIEW_REJECTION("7", "凭证复核"),
    TRANSFER_SIGN("44", "凭证签收"),
    SIGN_REJECTION("9", "签收驳回"),
    /**
     * 凭证融资
     */
    FINANCE("6", "凭证融资"),
    FINANCE_REVIEW("14", "融资复核"),
    PLAT_APPROVE("15", "平台审核"),
    BANK_REVIEW("16", "银行审核"),


    /**
     * 平台
     */
    PLAT_TICKET_APPROVE("15", "凭证审核"),

//    APPROVAL_REJECTION("8", "审批驳回"),
//    FINANCE_SIGN("10", "签署"),
//    CASHING("12", "兑付"),
//    CASHING_REJECT("13", "兑付平台驳回"),
    ;

    public static List<Integer> REVIEW_LIST = Arrays.asList(2, 7);

    public static List<Integer> APPROVE_LIST = Arrays.asList(3, 8);

    public static List<Integer> SIGN_LIST = Arrays.asList(4, 9);

    private String code;
    private String value;


    OperateLogTypeEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getValue(String code) {
        for (OperateLogTypeEnum statusEnum : OperateLogTypeEnum.values()) {
            if (statusEnum.code.equals(code)) {
                return statusEnum.value;
            }
        }
        return "";
    }


    public String getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
}
